package com.cgbl.cg.ui.mine

import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.cgbl.cg.R
import com.cgbl.cg.adapter.CareerPathAdapter
import com.cgbl.cg.adapter.CareerPathMoreAdapter
import com.cgbl.cg.databinding.AppActivityCareerPathBinding
import com.cgbl.cg.vm.mine.CareerPathViewModel
import com.robot.base.base.activity.GLBaseActivity
import com.robot.base.configs.AppConstants
import me.goldze.mvvmhabit.BR

@Route(path = AppConstants.Router.Mine.A_MINE_CAREER_PATH)
class CareerPathActivity : GLBaseActivity<AppActivityCareerPathBinding, CareerPathViewModel>() {

    private lateinit var careerAdapter: CareerPathAdapter

    private lateinit var careerMoreAdapter: CareerPathMoreAdapter

    override fun initContentView(savedInstanceState: Bundle?): Int =
        R.layout.app_activity_career_path

    override fun initVariableId(): Int = BR.viewModel

    override fun initComponents() {
        initTiterBar()
        careerAdapter = CareerPathAdapter()
        careerMoreAdapter = CareerPathMoreAdapter()
        binding.recyclerContent.apply {
            layoutManager = LinearLayoutManager(this@CareerPathActivity)
            adapter = careerAdapter
        }
        careerAdapter.setNewInstance(mutableListOf("", ""))

        binding.recyclerMore.apply {
            layoutManager = LinearLayoutManager(this@CareerPathActivity)
            adapter = careerMoreAdapter
        }
        careerMoreAdapter.setNewInstance(mutableListOf("", ""))

    }

    private fun initTiterBar() {
        val titleView = findViewById<TextView>(R.id.tv_title)
        val backView = findViewById<ImageView>(R.id.iv_back)
        titleView.text = "职业规划"
        backView.setOnClickListener { finish() }
    }
}